function ajax(url,cb){
    const xhr = new XMLHttpRequest;
    xhr.open("get",url,true)
    xhr.onload = function(){
        if(xhr.status === 200){
            cb(xhr.responseText)
        }
    }
    xhr.send();
}

function ajaxPromise(url){
    return new Promise(resolve=>{
        const xhr = new XMLHttpRequest;
        xhr.open("get",url,true)
        xhr.onload = function(){
            if(xhr.status === 200){
                resolve(xhr.responseText)
            }
        }
        xhr.send();
    })
    
}